
using CStock;
using System;
using System.Diagnostics;

using NUnit.Framework;
namespace TestCases.StockData
{
	

	/// <summary>Some simple Tests.</summary>
	/// 
	[TestFixture] 
	public class DataClass_IntradayTest : ProgramContext_TestCases
	{
		

		IDataClassFactory dataClassFactory;
        private const string shareName = "TestCaseShare";

        public DataClass_IntradayTest()
		{
            dataClassFactory = new DataClassFactory();
            this.dataClassFactory.StockObjectBase.ID = shareName;



			
        }

        public IDataClassFactory DataClassFactory
		{
			get
			{
                return dataClassFactory;
			}
		}
 
        [Test]
        public void Create_Intraday_Serialize()
        {
            Create_Intraday();
            
            IDataClassDaily dc = this.dataClassFactory.StockObjectBase as IDataClassDaily;
            dc.DataClassIntraday.Serialize();

        }
        [Test]
        public void Create_Intraday()
        {
            this.dataClassFactory.Create_Default();
            DataClassDaily dcd = this.dataClassFactory.StockObjectBase as DataClassDaily;
            dcd.ID = shareName;

            double startValue = 55;
            double randomPercentage = 0.1F;
            int myNumberOfDataItems = 20;

            ((DataClassFactory)this.dataClassFactory).Create_SampleQuotes_Intraday(startValue, randomPercentage, myNumberOfDataItems);



        }
		
		
        //[Test] 
        //public void SaveQuotesDaily()
        //{
        //    QuoteWriter.WriteQuotesToFile((IDataClass)this.dataClassFactory.StockObject);
        //}

		[Test] 
		public void Save()
		{
            
			//take care to leave some data in the initialization
			this.dataClassFactory.Serialize( );
			//this.dataClassFactory.DataClassIntraday.Serialize( );

		}
		[Test]
        public void DeSerialize_TestCaseShare()
		{

            this.dataClassFactory.StockObjectBase.ID = shareName;
            Assert.IsTrue(this.dataClassFactory.DeSerialize());

          
		}
	
    
	}

	
}